import request from '@/utils/request'
import {baseUrlConfig} from "@/config/config";
const basePath = baseUrlConfig.businessBaseUrl;


//获取分页列表
export const securityTemplateListPage: (data: any) => Promise<[]> = (data) => {
    return request({
      url: basePath + '/secure/securityTemplate/find/page',
      method: 'post',
      data
    })
  }

//存入模板
export const saveModel: (data: any) => Promise<[]> = (data) => {
    return request({
      url: basePath + '/secure/securityTemplate/saveModel',
      method: 'post',
      data
    })
  }

//查询模板配置
export const getModelData: (data: any) => Promise<[]> = (data) => {
  return request({
    url: basePath + '/secure/securityTemplate/getModelData',
    method: 'get',
    params: {id:data}
  })
}

//复制模板
export const copyModel: (data: any) => Promise<[]> = (data) => {
  return request({
    url: basePath + '/secure/securityTemplate/copyModel',
    method: 'post',
    data
  })
}

//删除模板
export const deleteModel: (data: any) => Promise<[]> = (data) => {
  return request({
    url: basePath + '/secure/securityTemplate/deleteModel',
    method: 'get',
    params: {id:data}
  })
}

//保存模板
export const updateJson: (data: any) => Promise<[]> = (data) => {
  return request({
    url: basePath + '/secure/modelRelation/updateJson',
    method: 'put',
    data
  })
}
